<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <ul class="container">

    </ul>
    <script>
        var users = [
            {
                name: "monika",
                age: 17,
                isSingle: true
            },
            {
                name: "zqs",
                age: 20,
                isSingle: false
            },

        ]

        var ul = document.querySelector('.container')


        users.forEach(user => {
            const li = document.createElement('li')
            const name = document.createElement('div')
            name.className = 'user-name'
            name.innerText = user.name
            li.appendChild(name)

            const age = document.createElement('div')
            age.className = 'user-age'
            age.innerText = user.age
            li.appendChild(age)

            const status = document.createElement('div')
            status.className = 'user-status'
            status.innerText = user.status ? '单身' : '已脱单'
            li.appendChild(status)

            ul.appendChild(li)

        })
    </script>
</body>

</html>